//
//  NoPictureView.m
//  QT
//
//  Created by 甘世清 on 2025/1/10.
//

#import "NoPictureView.h"
#import "AddPictureViewController.h"
@implementation NoPictureView

- (void)SQ_UIViewForSelfView{
    self.backgroundColor = UIColor.whiteColor;
    SQCustomButton * btn = [[SQCustomButton alloc]initType:SQCustomButtonLeftImageType imageSize:CGSizeMake(18, 18) midmargin:10];
    btn.text = SQNSLocalString(@"发布一条");
    btn.image = SQGetImage(@"tianjia");
    btn.font = FONT_MEDIUM(14);
    btn.textColor = SQColor333333;
    btn.layer.cornerRadius = 10;
    btn.layer.borderColor = SQColor333333.CGColor;
    btn.layer.borderWidth = 0.5;
    btn.backgroundColor = UIColor.whiteColor;
    [self addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.centerY.equalTo(self).offset(-40);
        make.height.mas_equalTo(50);
        make.width.mas_equalTo(SCREEN_WIDETH-40);
    }];
    [btn setTouchBlock:^(SQCustomButton * _Nonnull button) {
        AddPictureViewController * add = [[AddPictureViewController alloc]init];
        [[Manager SQ_getCurrentViewController].navigationController pushViewController:add animated:YES];
    }];
    [self addSubview:self.reloadBtn];
    [self.reloadBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.centerY.equalTo(self).offset(40);
        make.height.mas_equalTo(50);
        make.width.mas_equalTo(SCREEN_WIDETH-40);
    }];
    
}

- (SQCustomButton *)reloadBtn{
    if (!_reloadBtn) {
        _reloadBtn = [[SQCustomButton alloc]initType:SQCustomButtonLeftImageType imageSize:CGSizeMake(18, 18) midmargin:10];
        _reloadBtn.text = SQNSLocalString(@"再次刷新");
        _reloadBtn.image = SQGetImage(@"xiayige");
        _reloadBtn.font = FONT_MEDIUM(14);
        _reloadBtn.textColor = SQColor333333;
        _reloadBtn.layer.cornerRadius = 10;
        _reloadBtn.layer.borderColor = SQColor333333.CGColor;
        _reloadBtn.layer.borderWidth = 0.5;
        _reloadBtn.backgroundColor = UIColor.whiteColor;
    }
    return _reloadBtn;
}
@end
